package com.cdd.role.controller.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cdd.role.service.RoleService;
import com.common.entity.Role;
import com.common.untils.CommonResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *
 *
 * @author lenovo
 * @version 1.0
 * @since 2022-09-05  19:33:06
 */
@RestController
@RequestMapping("api/role/role")
public class ApiRoleController {
    @Autowired
    private RoleService roleService;
    @PostMapping("/selectAllRole")
    public List<Role> ApiSelectRoleALl(){
        return roleService.ApiSelectRoleALl();
    }
    //分页查询
    @PostMapping("/selectAllRoleName/{roleCurrentPage}/{rolePageSize}")
    public CommonResult selectAllRoleName(@PathVariable("roleCurrentPage") Integer roleCurrentPage, @PathVariable("rolePageSize") Integer rolePageSize, @RequestBody Role role){
        return roleService.selectAllRoleName(roleCurrentPage,rolePageSize,role);
    }
}
